package package2;

 class Num1 {
    public int a=2;
     public  int c=4;
     public int m=0;
     public void doBase()
     {
         System.out.println("执行了doBase()方法-----");
     }
}
 class son extends Num1{
     public int  b =9;
     public int d=8;
     public int m=1;
     public void test(){
         super.doBase();
     }
     public void test2(){
         System.out.println(this.d);
         System.out.println(this.b);
         System.out.println(m);//子类和父类都拥有时，优先考虑子类
         System.out.println(super.m);//当子类也有时要访问父类中与其相同的成员就用super
         System.out.println(super.a);
         System.out.println(super.c);
     }
 }
